# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=golang-github-nfnt-resize
pkgver=0.0.20180222
_commit=83c6a9932646f83e3267f353373d47347b6036b2
pkgrel=2
pkgdesc='Pure golang image resizing'
arch=('any')
url="https://github.com/nfnt/resize"
license=('custom:ISC')
depends=('go')
source=("$pkgname-$_commit.tar.gz::https://github.com/nfnt/resize/archive/$_commit.tar.gz")
sha512sums=('658fe80affcdf5df30009daeb3879406e42c7beb40267a8f3fd55e0522d701cb6db794018fbdd6fb04fc6ee7e464ba612d0aa691867fa6dbe297e29e26b8b298')

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  mkdir -p "$srcdir"/build/src/github.com/nfnt
  cp -a "$srcdir"/resize-$_commit "$srcdir"/build/src/github.com/nfnt/resize
  cd "$srcdir"/build/src/github.com/nfnt/resize
  go test -v $(go list ./...)
}

package() {
  mkdir -p "$pkgdir"/usr/share/gocode/src/github.com/nfnt
  cp -a "$srcdir"/resize-$_commit "$pkgdir"/usr/share/gocode/src/github.com/nfnt/resize

  install -Dm644 resize-$_commit/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
